import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({ //全局变量定义
	state: {
		openid: uni.getStorageSync('openid'),
		userinfoDetails: uni.getStorageSync('userinfoDetails'), // 头像姓名城市等。。。
		ppid: uni.getStorageSync('ppid'),
	},
	mutations: {
		login(state, res) {
			// state.isloginStatus = true;
			state.openid = res.openid
		},
		saveUserinfoDetails(state, res) {
			state.userinfoDetails = res
		},
		savePPid(state, id) {
			stage.ppid = id // 存ppid
		}
	},

})
export default store
